<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.longtop.com/intelliweb" prefix="e"%>
<%@ page isELIgnored="false"%>
<html>
	<head>
		<title>考核方案-第七步发布成绩-SJH</title>
	</head>
<e:View id="eView" designProperty="width: 1024; height: 768">
	<script type="text/javascript">SkinUtil.getSkin();</script>
	<script type="text/javascript">SkinUtil.getModuleSkin();</script>	
	<script type="text/javascript" src="<c:url value='/js/perform/perform.js'/>"></script>
	
	<div id="Invisual Controls" style="min-height: 40px;">
	<!--考核阶段 -->
		<e:Dataset id="Dataset_project_segment" pageSize="-1">
			<e:Field name="segmentId" label="分段ID" dataType="string"/>
			<e:Field name="projectId" label="考核方案ID" dataType="string"/>
			<e:Field name="cycleId" label="阶段周期ID" dataType="string"/>
			<e:Field name="segmentName" label="考核阶段名称" dataType="string"/>
			<e:Field name="status" label="状态" dataType="string"/>
			<e:Field name="startDate" label="开始日期" dataType="date"/>
			<e:Field name="endDate" label="结束日期" dataType="date"/>
			<e:Field name="scoreTime" label="计算时间"  dataType="date"/>
			<e:Field name="cycleName" label="阶段周期名称"  dataType="string"/>
		</e:Dataset>	
			
	<!-- 考核分段ID对应名称 -->
		<e:DataDropDown id="DataDropDown_segmentIdToName" dataset="Dataset_project_segment"
		      visibleFields="cycleName" codeField="segmentId" textField="cycleName" showColumnHeader="false" fixed="true"
		      onAfterSelect="DataDropDown_segmentIdToName_onAfterSelect()">
		</e:DataDropDown>
		
	<!-- 发布成绩 -->		
		<e:Command id="Command_issueScore" action="com.longtop.perform.kh.score.web.CountScoreAction" method="issueScore">
			<e:Parameter name="segmentId" dataType="string"></e:Parameter>
		</e:Command>		

<body style="overflow: auto">
<e:Page id="ePage" action="com.longtop.perform.kh.score.web.CountScoreAction" style="min-height: 80px; width: 100%; height: 100%;"  onAfterLoadPage="ePage_onAfterLoadPage()" onBeforeLoadPage="ePage_onBeforeLoadPage()">
	<table width="100%" height="100%" border="0" align="center" cellpadding="2" cellspacing="2">
		 <tr>
			<td align="left" valign="top">
					<table width="100%">
						<tr>
							<td valign="top" align="left">	
								<e:GroupBox id="GroupBox_project" style="width: 100%; " caption="发布方案成绩">
									<table style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="2">
										<tr>
											<td align="right" nowrap="nowrap">&nbsp;&nbsp;</td>
											<td align="right" nowrap="nowrap"><e:Label id="Label_projectName" caption="考核方案"/></td>
											<td align="left"> 
												<e:Text id="Text_projectName" style="width:250px" readOnly="true" />
	                						</td>									
											<td align="right" nowrap="nowrap"><e:Label id="Label_segmentName" caption="选择阶段"/></td>
											<td align="left" width="99%">
												<e:Text id="Text_segmentName" dropDown="DataDropDown_segmentIdToName" style="width:250px"/>
											</td>
										</tr>
										<tr>
											<td colspan="5" align="center"> 
												&nbsp;
	                						</td>											
										</tr>											
										<tr>
											<td colspan="5" align="center"> 
												<e:Button id="Button_issue" caption="发布成绩" icon="/images/setting.gif" style="width:80px" onClick="Button_count_onClick()" />
	                						</td>									
										</tr>										
									</table>
								</e:GroupBox>
							</td>
						</tr>
						<tr>
						
						</tr>	
					<table>
			</td>
		</tr>
	</table>
</e:Page>
</body>
<script language="Javascript">
	var projectId = '${param.projectId}';
	//init:
	function ePage_onBeforeLoadPage(){
		document.getElementById("Button_issue").disabled = true;	
	}
	function ePage_onAfterLoadPage(){
	 $J("Text_projectName").setValue(parent.$J("Text_projectName").getValue());//显示方案名称
		//考核方案无分段设置：
		if(isEmpty(Dataset_project_segment.getValue("cycleId"))){
			$J("Text_segmentName").setReadOnly(true);
			DataDropDown_segmentIdToName.onAfterSelect();
		}
	}
	//获取考核分段ID，设置为参数
	function DataDropDown_segmentIdToName_onAfterSelect(){
 		var segmentId = Dataset_project_segment.getValue("segmentId");
 		$J("Button_issue").setEnabled(true);
		Command_issueScore.parameters.setValue("segmentId",segmentId);
	}

	//计算成绩:
	function Button_count_onClick(){
		Command_issueScore.execute();
	}
</script>
</e:View>
</html>